package lab03.test01;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

/**
 * Created by dell on 2017/11/16.
 */
public class Test {
    public static void main(String[] args) {
      String path="D:\\echo.txt";
      BufferedWriter writer=null;

      try{
          writer=new BufferedWriter(new FileWriter(path));

          writer.write("hello");
          writer.newLine();

          writer.write("echo");
          writer.newLine();

          writer.write("bye");
          writer.newLine();
      } catch (IOException e) {
          e.printStackTrace();
      }
      finally{

          try {
              writer.close();
          } catch (IOException e) {
              e.printStackTrace();
          }

      }
    }
}
